<?php 
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
$w=$_REQUEST['winW']*98/100;
$mm=$w."px";
$c1=$w*4/100 ;
$c2=$w*5/100 ;
$c3=$w*18/100 ;
$c4=$w*6/100 ;
$c5=$w*6/100 ;
$c6=$w*6/100 ;
$c7=$w*20/100 ;
$c8=$w*4/100 ;
$c9=$w*10/100 ;
$c10=$w*6/100 ;
$c11=$w*9/100 ;
$c12=$w*6/100 ;

$connection1 = mysql_connect("1.234.20.151", "cam", "5678" ) ;
mysql_select_db("elicam", $connection1);
mysql_query("set names 'utf8'");
$sql = 'SELECT cf.id,cf.`name`,cf.`host`,cf.pos_x,cf.pos_y,cf.go_mode,cf.DVR,cf.IP,cf.`Port`,cf.UserID,cf.PW FROM `configcamera` cf order by cf.live_time desc';
$rs=mysql_query($sql);

?>
	<table cellspacing="0" cellpadding="0" border="0" width="<?php echo $mm;?>" >
	  <tr>
	    <td>
	       <table cellspacing="0" cellpadding="0" border="1" width="<?php echo $mm;?>" >
	         <tr>
	            <th width="<?php echo $c1."px";?>">No</th>
	            <th width="<?php echo $c2."px";?>">ID</th>
	            <th width="<?php echo $c3."px";?>">Name</th>
	            <th width="<?php echo $c4."px";?>">pos_x</th>
	            <th width="<?php echo $c5."px";?>">pos_y</th>
	            <th width="<?php echo $c6."px";?>">mode</th>
	            <th width="<?php echo $c7."px";?>">server</th>
	            <th width="<?php echo $c8."px";?>">DVR</th>
	            <th width="<?php echo $c9."px";?>">IP</th>
	            <th width="<?php echo $c10."px";?>">Port</th>
	            <th width="<?php echo $c11."px";?>">UserID</th>
	            <th width="<?php echo $c12."px";?>">PW</th>
	         </tr>
	       </table>
	    </td>
	  </tr>
	  <tr>
	    <td>
	       <div id="show" style="width:$mm; height:600px; overflow-y:auto; overflow-x:hidden;  clip-rect:(0px,$mm, 600px, 0px);" >
	       <?php 
	      // if($sl>0){
	       ?>
	         <table cellspacing="0" cellpadding="0" border="1" width="<?php echo $mm;?>" >
	         <?php 
	         $i=0;
	        	while($row=mysql_fetch_array($rs)){
	         ?>
	           <tr>
	             <td width="<?php echo $c1."px";?>"><?=(++$i)?></td>
	             <td width="<?php echo $c2."px";?>"><?=$row['id']?></td>
	             <td width="<?php echo $c3."px";?>"><?=$row['name']."&nbsp;"?></td>
	             <td width="<?php echo $c4."px";?>"><?=$row['pos_x']."&nbsp;"?></td>
	             <td width="<?php echo $c5."px";?>"><?=$row['pos_y']."&nbsp;"?></td>
	             <td width="<?php echo $c6."px";?>"><?if ($row['go_mode']==1){echo $l_come."&nbsp;";}else{echo $l_go."&nbsp;";} ?></td>
	             <td width="<?php echo $c7."px";?>"><?=$row['host']."&nbsp;"?></td>
	             <td width="<?php echo $c8."px";?>"><?=$row['DVR']."&nbsp;"?></td>
	             <td width="<?php echo $c9."px";?>"><?=$row['IP']."&nbsp;"?></td>
	             <td width="<?php echo $c10."px";?>"><?=$row['Port']."&nbsp;"?></td>
	             <td width="<?php echo $c11."px";?>"><?=$row['UserID']."&nbsp;"?></td>
	             <td width="<?php echo $c12."px";?>"><?php if (strlen($row['PW'])==0){echo "&nbsp;";}else{$vals="*"; for ($m=0;$m <strlen($row['PW']);$m++){?><?=$vals++;?><?php }}?></td>
	           </tr>
	          <?php }?>
	         </table>  
	       <?php 
	       //}
	       ?>
	       </div>
	    </td>
	  </tr>
	</table>